package com.elysium.controller.app;

import cn.dev33.satoken.annotation.SaIgnore;
import com.elysium.result.R;
import com.elysium.service.ICustomerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

// swagger注解：解释说明当前类的
@Tag(name = "小程序乘客对象",description = "小程序乘客对象")
@RestController
@RequestMapping("/app/customer")
public class AppCustomerController {

    @Autowired
    public ICustomerService customerService;

    /**
     * 小程序司机注册
     * @param openIdCode 获取openId所需要的code
     * @return
     */
    @Operation( summary= "小程序乘客注册",description = "小程序乘客注册接口")
    @Parameter(name = "openIdCode",description = "获取openId的code",required = true)
    @GetMapping(value = "/register/{openIdCode}")
    @SaIgnore
    public R<Void> register(@PathVariable("openIdCode") String openIdCode) {
        customerService.register(openIdCode);
        return R.success();
    }

}
